package io.kiki.sba.registry.store.api.meta;

import io.kiki.sba.registry.common.model.metaserver.ClientManagerAddress;
import io.kiki.sba.registry.common.model.metaserver.ClientManagerAddress.AddressVersion;
import io.kiki.sba.registry.common.model.metaserver.ClientManagerResult;

import java.util.Date;
import java.util.List;
import java.util.Set;


public interface ClientManagerAddressRepository {

    /**
     * client open
     */
    ClientManagerResult clientOpen(Set<AddressVersion> ipSet);

    /**
     * client off
     */
    ClientManagerResult clientOff(Set<AddressVersion> ipSet);

    /**
     * reduce
     */
    ClientManagerResult reduce(Set<AddressVersion> ipSet);

    ClientManagerAddress queryClientOffData();

    void waitSynced();

    List<String> getExpireAddress(Date date, int limit);

    int cleanExpired(List<String> expireAddress);

    int getClientOffSizeBefore(Date date);

    void wakeup();
}
